package org.hzero.order.infra.repository.impl;

import io.choerodon.core.domain.Page;
import io.choerodon.mybatis.pagehelper.PageHelper;
import io.choerodon.mybatis.pagehelper.domain.PageRequest;
import org.hzero.mybatis.base.impl.BaseRepositoryImpl;
import org.hzero.order.domain.entity.SoHeader;
import org.hzero.order.domain.repository.SoHeaderRepository;
import org.hzero.order.infra.mapper.SoHeaderMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 销售订单头表 资源库实现
 *
 * @author hyc 2021-03-12 11:07:05
 */
@Component
public class SoHeaderRepositoryImpl extends BaseRepositoryImpl<SoHeader> implements SoHeaderRepository {
    @Autowired
    private SoHeaderMapper soHeaderMapper;

    @Override
    public Page<SoHeader> pageAndSortWithPrice(PageRequest pageRequest, SoHeader soHeader) {
        return PageHelper.doPageAndSort(pageRequest, () -> soHeaderMapper.pageAndSortWithPrice(soHeader));
    }
}
